package cn.myspringboot.controller.manager;

import cn.myspringboot.domain.OpenIdResult;
import cn.myspringboot.service.WechatRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechat")
public class WechatRegisterController {
    @Autowired
    private WechatRegisterService wechatRegisterService;

    @GetMapping("/register/{code}")
    public OpenIdResult getOpenId(@PathVariable("code") String code) {
        return wechatRegisterService.getOpenId(code);
    }


}
